package com.itlong.cloud.resource;

import com.itlong.cloud.commons.service.IVisitorFaceService;
import com.itlong.cloud.iottp.IIotVisitorFaceServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <desc>
 *      访客人脸接口暴露。
 * <desc/>
 *
 * @createDate 2019/03/04.
 */
@RestController
public class IotVisitorFaceServiceResource implements IIotVisitorFaceServiceClient {

    @Autowired
    private IVisitorFaceService iVisitorFaceService;

    /**
     * <desc>
     *      删除过期访客人脸
     * <desc/>
     *
     * @return
     * @author Qiang.S
     * @createDate 2019/03/04
     */
    @Override
    @RequestMapping(path = "/iotTp/visitor/visitorFaceDelete",method = RequestMethod.POST)
    public void visitorFaceDelete() throws Exception {
        iVisitorFaceService.visitorFaceDelete();
    }

    /**
     * <desc>
     *      注销用户删除人脸
     * </desc>
     *
     * @param userId
     * @author Jiaqi.X
     * @createDate 2020/06/17s
     */
    @PostMapping(path = "/iotTp/visitor/deleteUserFace")
    public void deleteUserFace(@RequestParam("userId") String userId){
        iVisitorFaceService.deleteUserFace(userId);
    }

    /**
     * <desc>
     *      京东非标-注销用户删除人脸
     * </desc>
     *
     * @param userId 用户id
     * @Author Zhu.yj
     * @createDate  2020/12/23
     */
    @Override
    @PostMapping(path = "/iotTp/visitor/deleteJdUserFace")
    public void deleteJdUserFace(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) {
        iVisitorFaceService.deleteJdUserFace(userId, projectId);
    }
}
